//
//  MyTabView.h
//  ebox
//
//  Created by hzm on 16/7/25.
//  Copyright © 2016年 BoingPay. All rights reserved.
//

#import <UIKit/UIKit.h>


@interface MyTabView : UIView

@property (nonatomic, assign) CGFloat redPointOffset;   // 0 ~ 1
@property (weak, nonatomic) IBOutlet UICollectionView *collectionTypeSelect;
@property (weak, nonatomic) IBOutlet UIView *viewIndicator;
@property (weak, nonatomic) IBOutlet NSLayoutConstraint *consIndicatorW;
@property (weak, nonatomic) IBOutlet NSLayoutConstraint *consIndicatorX;

@property (nonatomic, assign) BOOL showSeperator;

// alloc already addSubview
+ (instancetype)tabViewWithFrameView:(UIView *)view;

// alloc
+ (instancetype)tabViewWithRect:(CGRect)rc;

// titles is array of NSString
- (void)setTabTitles:(NSArray *)titles font:(UIFont *)font selColor:(UIColor *)selColor unselColor:(UIColor *)unselColor;

// color of background
- (void)setTabBackgroundColor:(UIColor *)color;

// color of indicator
- (void)setIndicatorColor:(UIColor *)color;

// show or hidden, same count as titles
- (void)setBodyViews:(NSArray *)views;

// select index
- (void)selectIndex:(NSInteger)index;
- (void)selectIndex:(NSInteger)index animated:(BOOL)anim;

// red point
- (void)setRedPoint:(NSInteger)num index:(NSInteger)index;

// callback
- (void)setSelectionChangeHandler:(id)target action:(SEL)action;

// update width (need to call in viewDidLayoutSubviews if width is unknown)
- (void)updateFrameWidth:(CGFloat)width;

@end
